package com.wanxi.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Li
 * @Date 2023/5/5 19:09
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel(value = "新闻",description = "用于描述新闻对象")
@TableName("news")
public class NewsModel {
    @TableId(value = "id", type = IdType.ASSIGN_ID)//雪花算法
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "新闻id",example = "1678239961299619841")
    private Long id;
    @ApiModelProperty(value = "新闻标题",example = "xx公司宣布今日上市")
    private String title;
    @ApiModelProperty(value = "新闻图片",example = "/xx.png")
    private String img;
    @ApiModelProperty(value = "新闻发布时间",example = "2023-07-04 8:42:20")
    private String time;
    @ApiModelProperty(value = "新闻内容",example = "今日，成都市xx公司CEO，宣布公司上市")
    private String content;
    @ApiModelProperty(value = "新闻状态",example = "1")
    private Integer enable;
    @ApiModelProperty(value = "备注",example = "社会资讯")
    private String remark;
    @ApiModelProperty(value = "修改时间",example = "2023-07-04 10:42:20")
    private String updateTime;
    @ApiModelProperty(value = "新闻类型id",example = "1678239961299619841")
    private Integer newsId;

    @TableField(exist = false)
    private String startTime;
    @TableField(exist = false)
    private String endTime;
    @TableField(exist = false)
    private String newsName;
    @TableField(exist = false)
    private Integer page; //页数
    @TableField(exist = false)
    private Integer limit; //条数



}
